package cn.ywang.concurrent.seven;

import java.util.concurrent.BlockingQueue;

/**
 * @author BeatificWang
 * @date 2019/8/1 21:33
 */
public class MessagePulisher extends Thread {

	private BlockingQueue<String> queue;

	private String message;

	public MessagePulisher(BlockingQueue<String> queue, String message) {
		this.queue = queue;
		this.message = message;
	}

	@Override
	public void run() {
		try {
			this.queue.put(this.message);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("发送消息：" + this.message);
	}
}
